/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function eventoImprimirLD() {
    $("#panelSuperior").empty();
    $("#panelSuperior").load("ui/html/accounting/cl/dialogLibroDiario.html", function() {
        $("#dialog-filtro-librold").hide();
        $("#dialog-filtro-librold").dialog({
            resizable: false,
            autoOpen: false,
            modal: true,
            show: "scale",
            hide: 'explode',
            buttons: {
                "GENERAR": function() {
                    $(this).dialog("close");
                    var check = "false"; //$('#checkAniold').is(':checked');
                    var anio = $("#txtAniold").val();
                    var mes = $("#idMesld").val();
                    load = new ajaxLoader();
                    var x = screen.width / 2 - 600 / 2;
                    var y = screen.height / 2 - 300 / 2;
                    var imprimir = URI_ARISTO + "?mod=CONTA&node=" + _IMPRIMIR_LIBRODIARIO + "&anio=" + anio + "&mes=" + mes + "&check=" + check;
                    window.open(imprimir, "GENERANDO LIBRO DIARIO", 'height=300,width=600,resizable=no,menubar=no,status=1,toolbar=1,left=' + x + ',top=' + y); //'_blank');
                    if (load)
                        load.remove();
                }
            }
        });

        $("#txtAniold").val(new Date().getFullYear());
        /*$("#checkAniold").change(function() {
         var check = $('#checkAniold').is(':checked');
         if(check) {
         $("#filald").hide();
         } else {
         $("#filald").show();
         }
         });
         */
        $("#dialog-filtro-librold").dialog("open");
        //$("#checkAniold").change();
    });
    return false;
}

function eventoImprimirLC() {
    $("#panelSuperior").empty();
    $("#panelSuperior").load("ui/html/accounting/cl/dialogLibroCaja.html", function() {
        $("#dialog-filtro-librolc").hide();
        $("#dialog-filtro-librolc").dialog({
            resizable: false,
            autoOpen: false,
            modal: true,
            show: "scale",
            hide: 'explode',
            buttons: {
                "GENERAR": function() {
                    $(this).dialog("close");
                    var check = "false"; //$('#checkAniold').is(':checked');
                    var anio = $("#txtAniolc").val();
                    var mes = $("#idMeslc").val();
                    load = new ajaxLoader();
                    var x = screen.width / 2 - 600 / 2;
                    var y = screen.height / 2 - 300 / 2;
                    var imprimir = URI_ARISTO + "?mod=CONTA&node=" + _IMPRIMIR_LIBROCAJA + "&anio=" + anio + "&mes=" + mes + "&check=" + check;
                    window.open(imprimir, "GENERANDO LIBRO CAJA", 'height=300,width=600,resizable=no,menubar=no,status=0,toolbar=0,left=' + x + ',top=' + y); //'_blank');
                    if (load)
                        load.remove();
                }
            }
        });

        $("#txtAniolc").val(new Date().getFullYear());
        /*$("#checkAniold").change(function() {
         var check = $('#checkAniold').is(':checked');
         if(check) {
         $("#filald").hide();
         } else {
         $("#filald").show();
         }
         });
         */
        $("#dialog-filtro-librolc").dialog("open");
        //$("#checkAniold").change();
    });
    return false;
}

function eventoImprimirLB() {
    $("#panelSuperior").empty();
    $("#panelSuperior").load("ui/html/accounting/cl/dialogLibroBanco.html", function() {
        $("#dialog-filtro-librolb").hide();
        $("#dialog-filtro-librolb").dialog({
            resizable: false,
            autoOpen: false,
            modal: true,
            show: "scale",
            hide: 'explode',
            buttons: {
                "GENERAR": function() {
                    $(this).dialog("close");
                    var check = "false"; //$('#checkAniold').is(':checked');
                    var anio = $("#txtAniolb").val();
                    var mes = $("#idMeslb").val();
                    load = new ajaxLoader();
                    var x = screen.width / 2 - 600 / 2;
                    var y = screen.height / 2 - 300 / 2;
                    var imprimir = URI_ARISTO + "?mod=CONTA&node=" + _IMPRIMIR_LIBROBANCO + "&anio=" + anio + "&mes=" + mes + "&check=" + check;
                    window.open(imprimir, "GENERANDO LIBRO BANCO", 'height=300,width=600,resizable=no,menubar=no,status=0,toolbar=0,left=' + x + ',top=' + y); //'_blank');
                    if (load)
                        load.remove();
                }
            }
        });

        $("#txtAniolb").val(new Date().getFullYear());
        /*$("#checkAniold").change(function() {
         var check = $('#checkAniold').is(':checked');
         if(check) {
         $("#filald").hide();
         } else {
         $("#filald").show();
         }
         });
         */
        $("#dialog-filtro-librolb").dialog("open");
        //$("#checkAniold").change();
    });
    return false;
}

function eventoImprimirLM() {
    $("#panelSuperior").empty();
    $("#panelSuperior").load("ui/html/accounting/cl/dialogLibroMayor.html", function() {
        $("#dialog-filtro-librolm").hide();
        $("#dialog-filtro-librolm").dialog({
            resizable: false,
            autoOpen: false,
            modal: true,
            show: "scale",
            hide: 'explode',
            buttons: {
                "GENERAR": function() {
                    $(this).dialog("close");
                    var check = "false"; //$('#checkAniold').is(':checked');
                    var anio = $("#txtAniolm").val();
                    var mes = $("#idMeslm").val();
                    load = new ajaxLoader();
                    var x = screen.width / 2 - 600 / 2;
                    var y = screen.height / 2 - 300 / 2;
                    var imprimir = URI_ARISTO + "?mod=CONTA&node=" + _IMPRIMIR_LIBROMAYOR + "&anio=" + anio + "&mes=" + mes + "&check=" + check;
                    window.open(imprimir, "GENERANDO LIBRO MAYOR", 'height=300,width=600,resizable=no,menubar=no,status=0,toolbar=0,left=' + x + ',top=' + y); //'_blank');
                    if (load)
                        load.remove();
                }
            }
        });

        $("#txtAniolm").val(new Date().getFullYear());
        $("#dialog-filtro-librolm").dialog("open");
    });
    return false;
}

function eventoImprimirBGeneral() {
    $("#panelSuperior").empty();
    $("#panelSuperior").load("ui/html/accounting/cl/dialogLibroBalanceGeneral.html", function() {
        $("#dialog-filtro-librolbg").hide();
        $("#dialog-filtro-librolbg").dialog({
            resizable: false,
            autoOpen: false,
            modal: true,
            show: "scale",
            hide: 'explode',
            buttons: {
                "GENERAR": function() {
                    $(this).dialog("close");
                    var check = "false"; //$('#checkAniold').is(':checked');
                    var anio = $("#txtAniolbg").val();
                    var mes = $("#idMeslbg").val();
                    load = new ajaxLoader();
                    var x = screen.width / 2 - 600 / 2;
                    var y = screen.height / 2 - 300 / 2;
                    var imprimir = URI_ARISTO + "?mod=CONTA&node=" + _IMPRIMIR_LIBROBGENERAL + "&anio=" + anio + "&mes=" + mes + "&check=" + check;
                    window.open(imprimir, "GENERANDO LIBRO BALANCE GENERAL", 'height=300,width=600,resizable=no,menubar=no,status=0,toolbar=0,left=' + x + ',top=' + y); //'_blank');
                    if (load)
                        load.remove();
                }
            }
        });

        $("#txtAniolbg").val(new Date().getFullYear());
        $("#dialog-filtro-librolbg").dialog("open");
    });
    return false;
}